package AOP;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * User: cool
 * Date: 2019/8/11
 * Time: 16:30
 * 动态代理类
 */
public class UserDaoDProxy implements InvocationHandler {
    private Object object;

    public UserDaoDProxy(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("加日志、开户事务 begin");
        Object invoke = method.invoke(object, args);
        System.out.println("加日志、开户事务 end");
        return invoke;

    }
}
